<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>用户列表</title>
    <script src="js/jquery.js"></script>
</head>
<body>
<div class="panel admin-panel">
    <div class="panel-head"><strong class="icon-reorder">用户列表</strong> <a href="" style="float:right; display:none;">添加博文</a></div>
    <div class="padding border-bottom">
        <ul class="search" style="padding-left:10px;">
            <li> <a class="button border-main icon-plus-square-o" href="User_all.html"> 所有用户</a> </li>
            <li> <a class="button border-main icon-plus-square-o" href="add.html"> 添加用户</a> </li>
            <li> <a class="button border-main icon-plus-square-o" href="add.html"> 删除用户</a> </li>
            <li> <a class="button border-main icon-plus-square-o" href="add.html"> 修改用户</a> </li>
        </ul>
    </div>
    <table class="table table-hover text-center">
        <tr>
            <th style="text-align:left; padding:10px ;width: 10%">
                <input type="checkbox"  id=" checkall" for= />
                <label for=" checkall" style='vertical-align:middle;display:inline-block'>全选 </label>
            </th>
            <th width="10%">用户编号</th>
            <th width="10%">密码</th>
            <th width="10%">头像</th>
            <th width="10%">邮箱</th>
            <th width="10%">电话号码</th>
            <th width="15%">上次登录时间</th>
            <th width="10%">更新时间</th>
            <th width="310">操作</th>
        </tr>
        <tr>
            <td style="text-align:left; padding-left:20px;">
                <input type="checkbox" name="box" value="{{$value->id}}}">
                </td>
            <td><input type="text" name="sort[1]" value="1" style="width:100px; text-align:center; border:1px solid #ddd; padding:10px 0;" /></td>
            <td width="10%">w123</td>
            <td width="10%"><img src="../images/白图.jpg" width="70" height="50" /></td>
            <td width="10%">2545972806@qq.com</td>
            <td width="10%">17628093215</td>
            <td width="15%">2020.4.09</td>
            <td width="10%">2020.9.15</td>
            <tr>
            <div class="button-group"> <a class="button border-main" href="add.html"><span class="icon-edit"></span> 修改</a> <a class="button border-red" href="javascript:void(0)" onclick="return del(1,1,1)"><span class="icon-trash-o"></span> 删除</a> </div></td>
            </th>
        </tr>
        <tr>
            <td colspan="8"><div class="pagelist"> <a href="">上一页</a> <span class="current">1</span><a href="">2</a><a href="">3</a><a href="">下一页</a><a href="">尾页</a> </div></td>
        </tr>
    </table>
</div>

<script type="text/javascript">
    //全选
    $(function () {
        $("#checkall").click(function () {
            var useerids = this.checked;
            $("input[name=box]").each(function () {
                this.checked = userids;
            });
        });
        $("input[name=box]").click(function () {
                var length = $("input[name=box]:checkbox").Length();
                var len = $("input[name=box]").Length();
                if (length == len) {
                    $("#checkall").get(0).checked = true;
                }else {
                    $("#checkall").get(0).checked = false;
                }
        });
    });
    //全选
    /*$("#checkall").click(function(){
        $("input[name='box']").each(function(){
            if (this.checked) {
                this.checked = false;
            }
            else {
                this.checked = true;
            }
        });
    })*/
    //批量删除
    function DelSelect(){
        var Checkbox=false;
        $("input[name='id[]']").each(function(){
            if (this.checked==true) {
                Checkbox=true;
            }
        });
        if (Checkbox){
            var t=confirm("您确认要删除选中的内容吗？");
            if (t==false) return false;
            $("#listform").submit();
        }
        else{
            alert("请选择您要删除的内容!");
            return false;
        }
    }
    //批量排序
    function sorts(){
        var Checkbox=false;
        $("input[name='id[]']").each(function(){
            if (this.checked==true) {
                Checkbox=true;
            }
        });
        if (Checkbox){

            $("#listform").submit();
        }
        else{
            alert("请选择要操作的内容!");
            return false;
        }
    }

    //批量首页显示
    function changeishome(o){
        var Checkbox=false;
        $("input[name='id[]']").each(function(){
            if (this.checked==true) {
                Checkbox=true;
            }
        });
        if (Checkbox){

            $("#listform").submit();
        }
        else{
            alert("请选择要操作的内容!");

            return false;
        }
    }

</script>
</body>
</html>